package com.deer.wms.system.manage.model.permission;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

/**
 * @author guo
 */
@Getter
@Setter
@NoArgsConstructor
public class Permission {
    /**
     * 权限信息id
     */
    @Id
    @Column(name = "permission_id")
    @TableId(type = IdType.AUTO)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer permissionId;

    /**
     * 资源信息id
     */
    @Column(name = "resource_id")
    private Integer resourceId;

    /**
     * 授权对象类型：user=用户授权；role=角色授权；
     */
    @Column(name = "object_type")
    private String objectType;

    /**
     * 授权对象信息id：如果是用户授权就是用户信息id，如果是角色授权就是角色信息id
     */
    @Column(name = "object_id")
    private Integer objectId;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 修改时间
     */
    @Column(name = "modify_time")
    private Date modifyTime;
}